<head>
	<!--<link rel="stylesheet" type="text/css" href="/BackEndRecursosHumanos/app/webroot/css/smoothness/jquery-ui-1.10.3.custom.css">
	<script type="text/javascript" src="/BackEndRecursosHumanos/app/webroot/js/jquery/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="/BackEndRecursosHumanos/app/webroot/js/jquery/jquery-ui-1.10.3.custom.min.js"></script>
	<script type="text/javascript" src="/BackEndRecursosHumanos/app/webroot/js/jquery/jquery.maskedinput.js" ></script>
	<script src="/BackEndRecursosHumanos/app/webroot/js/jquery/jquery.mousewheel.js"></script>
  	<script src="/BackEndRecursosHumanos/app/webroot/js/globolize/globalize.js"></script>-->
	
	<script>
		function cargar_datos()
		{
			
			<?php 
				
				if ($modulos[0]['MS_1']['modulo_sistema_id'] == null)
				{
					echo "$('#ModuloSistemaModuloSistemaId').val(0);";
				}
				else 
				{
			
					echo "$('#ModuloSistemaModuloSistemaId').val(".$modulos[0]['MS_1']['modulo_sistema_id']." );";
				
				}
			?>
			
		}
	    
	</script>
	
	<script>
		setTimeout(function() 
			{
				$('#flashMessage').fadeOut('slow');
			}, 10000);
		
		
	</script>
	
	<script>
             $(document).ready(function() 
             {
			    cargar_datos();
			 });
    </script>
	
</head>

<body >
	<legend>Editar un Modulo del Sistema</legend>
	
	<?php echo $this->Session->flash() ?>
	<a onclick="showConsult();" href="#">
	<img id="blah" src="/BackEndRecursosHumanos/app/webroot/img/button_back.png" alt="your image" width="30px" height="30px" />
	<br />	
	<lable>Regresar</label>
	</a>
	<br />
	<br />
	<center>
		<?php echo $this->Form->create("ModuloSistema", array(
																'onsubmit' => 'editModulo('.$modulos[0]['MS_1']['id'].')',
																));

			 ?>
		<fieldset class="fieldset_modulo">
			<legend><b>Informacion Referente al Modulo del Sistema</b></legend>
			
			<table>
				<tr>
					<td>
						<center>
							<label onb></label>
							
		
							<table >
								<tr>
									<td>
										<center>
											<?php 
													echo $this->Form->input('id', array (	'type' => 'hidden',
																							'value' => $modulos[0]['MS_1']['id']
																						)
																		   );
													echo $this->Form->input('nombre_modulo_sistema',array(
																									'label' => 'Nombre Modulo',
																									'value' => $modulos[0]['MS_1']['nombre_modulo_sistema']
																							   )
												 						 ); 
											?>
										</center>
									</td>
								</tr>
								<tr>
									<td>
										<center>
											<?php
																
													echo $this->Form->input('modulo_sistema_id', array(
																							            'options' => array($lista_modulos),
																										'label' => 'Módulo Perteneciente'
																								   )
																		   );
											?>
										</center>
									</td>
								</tr>
								
								<tr>
									<td>
										<center>
											<?php 	echo $this->Form->label('Descripcion del Módulo');
													echo $this->Form->textarea('descripcion_modulo_sistema', array(
																											'class' => 'text_area',
																											'label' => 'Descripcion del Módulo',
																											'value' => $modulos[0]['MS_1']['descripcion_modulo_sistema']
																										 )
																				 	 ); 
										    ?>
									    </center>
									</td>
								</tr>
					
							</table>
							
							
							
						</center>
					</td>
				</tr>
			</table>
		</fieldset>
		
		<?php
		if ($errors)
		{
		?>
		<div class="input text required error" style ="width: 50%">
	    	<center>
				 	Cantidad de Errores Encontrados en el Formulario: <b><?php echo count($errors); ?></b>
		    		<br />
		    		<table style="color: #9E2424">
				    	<tr>
				    		<td>
				    			<center>
				    				<b>Campo</b>
				    			</center>
				    		</td>
				    		<td>
				    			<center>
				    				<b>Error</b>
				    			</center>
				    		</td>
				    	</tr>
				    	
				    	<?php 
				    		foreach ($errors as $error) 
				    		{
						?>
						<tr style="background-color: #FFDACC;">
							<td>
								<center>
									<?php
										echo $error['campo'];
									?>
								</center>
							</td>
							<td>
								<center>
									<?php
										echo $error['error'];
									?>
								</center>
								
							</td>
						</tr>
						<?php
							}
				    	?>
				    	
				    </table>
	
	    	</center>
    	</div>
    	<?php
    	}
    	?>
	    
		
		<?php 
		
		/*echo $this->Form->button('Guardar',array(
	  												'class' => 'boton_regular',
	  												'type' => 'button',
													'onclick' => 'editModulo('.$modulos[0]['MS_1']['id'].')',
	  												'label' => array(
	  																	'display: none:'
																	)
	  											)
								);*/
		echo $this->Form->end('Guardar');?>
	</center>
</body>